package com.njcky.constant;

import java.util.HashMap;
import java.util.Map;

/**
 * @Author: lcy
 * @Date: 2023/7/3 18:54
 * @Desc:
 */
public class SmxConstant {
//    ============================线程池配置=========================
	/**
	 * 核心线程数
	 */
	public static final Integer CORE_POOL_SIZE = 10;
	/**
	 * 最大线程数
	 */
	public static final Integer MAX_POOL_SIZE = 600;
	/**
	 * 队列大小
	 */
	public static final Integer QUEUE_CAPACITY = 128;
	/**
	 * 存活时间
	 */
	public static final Integer ALIVE_SECONDS = 5;
	/**
	 * 线程名称前缀
	 */
	public static final String NAME_PREFIX = "smx-service-";

//    ============================远程请求参数==============================
	/**
	 * https协议
	 */
	public static final String PROTOCOL_HTTPS = "https://";

	/**
	 * https协议
	 */
	public static final String PROTOCOL_HTTP = "http://";

	/**
	 * 获取accessToken的请求地址
	 */
	public static final String ACCESS_TOKEN_URI = "/idp/oauth2/getToken?";

	/**
	 * 获取用户信息uri
	 */
	public static final String GET_USER_INFO_URI = "/idp/oauth2/getUserInfo?";

	/**
	 * 获取tokenId用户信息uri
	 */
	public static final String GET_TOKEN_ID_USER_INFO_URI = "/idp/restful/getIDPUserAttributes?";

	/**
	 * 检验tokenId地址
	 */
	public static final String CHECK_TOKEN_ID_URI = "/idp/restful/isIDPTokenValid?";

	/**
	 * 检验tokenId地址
	 */
	public static final String PUSH_MIX_MIS_GX = "/Pipeline/hybridConnectionsjtj";


	/**
	 * clientId
	 */
	public static final String CLIENT_ID = "client_id=";

	/**
	 * code
	 */
	public static final String CODE = "code=";

	/**
	 * clientSecret
	 */
	public static final String CLIENT_SECRET = "client_secret=";

	/**
	 * grantType
	 */
	public static final String GRANT_TYPE = "grant_type=";

	/**
	 * accessToken
	 */
	public static final String ACCESS_TOKEN = "access_token=";

	/**
	 * appId
	 */
	public static final String APP_ID = "appId=";

	/**
	 * appId
	 */
	public static final String TOKEN_ID = "tokenId=";

	/**
	 * appId
	 */
	public static final String REMOTE_IP = "remoteIp=";

	/**
	 * 冒号
	 */
	public static final String COLON = ":";

	/**
	 * 参数拼接符
	 */
	public static final String AND = "&";

//    ===================================================redis key===================================

	/**
	 * JSSMX公司材质生命
	 */
	public static final String JSSMX_CZ_LIFE = "jssmx:czLife";
	/**
	 * 管线统计
	 */
	public static final String JSSMX_GX_STATISTICS = "jssmxStatistics:gxStatistics:";
	/**
	 * 超期管线统计
	 */
	public static final String JSSMX_OVERDUEGX_STATISTICS = "jssmxStatistics:overdueGxStatistics:";
	/**
	 * 无法统计的管线统计
	 */
	public static final String JSSMX_UNABLEGX_STATISTICS = "jssmxStatistics:unableGxStatistics:";

	/**
	 * 超期管线材质分布统计
	 */
	public static final String JSSMX_OVERDUECZ_STATISTICS = "jssmxStatistics:overdueCz:";

	/**
	 * 超期管线建设年代分布统计
	 */
	public static final String JSSMX_OVERDUEJSND_STATISTICS = "jssmxStatistics:overdueJsnd:";

	/**
	 * 超期管线区域分布统计
	 */
	public static final String JSSMX_OVERDUEAREA_STATISTICS = "jssmxStatistics:overdueArea:";

	/**
	 * 超期管线超期时长分布统计
	 */
	public static final String JSSMX_OVERDUE_STATISTICS = "jssmxStatistics:overdue:";

	/**
	 * 预计超期管线长度
	 */
	public static final String JSSMX_EXPECTOVERDUE_STATISTICS = "jssmxStatistics:expectOverdue:";

	/**
	 * 预计超期管线长度
	 */
	public static final String JSSMX_OVERDUE_OVERVIEW = "jssmxStatistics:overdueOverview:";

	//=====================================general======================================================

	/**
	 * 建筑占用任务
	 */
	public static final String BUILDING_OCCUPATION_TASK = "builderOccupationTask";


	/**
	 * 管线与建筑物间距分析
	 */
	public static final String PIPE_BUILDING_DISTANCE_ANALYSIS = "pipeBuildingDistanceAnalysis";
	/**
	 * 管线交叉穿越分析
	 */
	public static final String PIPE_CROSS_ANALYSIS = "pipeCrossAnalysis";
	/**
	 * 管线安全间距分析
	 */
	public static final String PIPE_DISTANCE_ANALYSIS = "pipeDistanceAnalysis";

	/**
	 * 覆土深度分析
	 */
	public static final String PIPE_BURIAL = "pipeBurial";


	//=====================================exception desc======================================================

	/**
	 * 没有建筑物
	 */
	public static final String NO_BUILDING = "无建筑物";
	/**
	 * 执行重复
	 */
	public static final String EXECUTING_REPEAT = "重复执行，执行失败";
	/**
	 * msg 推送错误
	 */
	public static final String MSG_PUSH_ERROR = "消息推送异常";
	/**
	 * 创建任务错误
	 */
	public static final String CREATE_TASK_ERROR = "提交占压任务失败";


	//=====================================拦截接口uri======================================================

	/**
	 * 深入分析
	 *///挖深分析接口数据脱敏
	public static final String DIG_DEEP_ANALYSIS = "/diDeep/diDeepAnalysis";
	/**
	 * 连接分析
	 *///连通性分析接口数据脱敏
	public static final String CONNECT_ANALYSIS = "/connect/connectivityAnalysis";

	/**
	 * 脱敏字段
	 */
	public static final String GD_DMGC = "dmgc";
	/**
	 * 脱敏字段
	 */
	public static final String GX_QDGC = "qdgc";
	/**
	 * 脱敏字段
	 */
	public static final String GX_ZDGC = "zdgc";
	/**
	 * 脱敏字段
	 */
	public static final String GX_QDMS = "qdms";
	/**
	 * 脱敏字段
	 */
	public static final String GX_ZDMS = "zdms";
	/**
	 * 脱敏字段
	 */
	public static final String GX_GJ = "gj";
	/**
	 * 脱敏字段
	 */
	public static final String GX_YL = "yl";
	/**
	 * 脱敏字段
	 */
	public static final String GD_DMGCTM = "dmgcTm";
	/**
	 * 脱敏字段
	 */
	public static final String GX_QDGCTM = "qdgcTm";
	/**
	 * 脱敏字段
	 */
	public static final String GX_ZDGCTM = "zdgcTm";
	/**
	 * 脱敏字段
	 */
	public static final String GX_QDMSTM = "qdmsTm";
	/**
	 * 脱敏字段
	 */
	public static final String GX_ZDMSTM = "zdmsTm";
	/**
	 * 脱敏字段
	 */
	public static final String GX_GJTM = "gjTm";
	/**
	 * 脱敏字段
	 */
	public static final String GX_YLTM = "ylTm";

	/**
	 * 脱敏字段
	 */
	public static final String GD_DMGC_TM = "dmgc_tm";
	/**
	 * 脱敏字段
	 */
	public static final String GX_QDGC_TM = "qdgc_tm";
	/**
	 * 脱敏字段
	 */
	public static final String GX_ZDGC_TM = "zdgc_tm";
	/**
	 * 脱敏字段
	 */
	public static final String GX_QDMS_TM = "qdms_tm";
	/**
	 * 脱敏字段
	 */
	public static final String GX_ZDMS_TM = "zdms_tm";
	/**
	 * 脱敏字段
	 */
	public static final String GX_GJ_TM = "gj_tm";
	/**
	 * 脱敏字段
	 */
	public static final String GX_YL_TM = "yl_tm";

	/**
	 * 管线与建筑物分析最大管线分析数量
	 */
	public static final Integer MAX_PIPE_BUILDING_ANALYSIS = 1000000;

	/**
	 * 默认最大分析数量
	 */
	public static final Integer MAX_ANALYSIS = 50000;

	/**
	 * 管线与建筑物分析管线buffer半径：米
	 */
	public static final Integer BUFFER_PIPE_BUILDING_ANALYSIS = 15;

	//小型管径、中型、大型、特大型
	public static final Double MIN_GJ = 0.1;
	public static final Double MIDDLE_GJ = 0.2;
	public static final Double MAX_GJ = 0.3;
	public static final Double SUPER_MAX_GJ = 0.4;

	// 建筑物和管线间距
	public static final Map<String, Map<String,Double>> jzwAndGx =  new HashMap(){{
		put("RQ_TRQ_LINE", new HashMap(){{
			put("低压",0.7);
			put("中压B",1);
			put("中压A",1.5);
			put("次高压B",5.0);
			put("次高压A",13.5);
		}});
		put("RQ_YHQ_LINE", new HashMap(){{
			put("低压",0.7);
			put("中压B",1);
			put("中压A",1.5);
			put("次高压B",5.0);
			put("次高压A",13.5);
		}});
		put("RQ_MQG_LINE", new HashMap(){{
			put("低压",0.7);
			put("中压B",1);
			put("中压A",1.5);
			put("次高压B",5.0);
			put("次高压A",13.5);
		}});
		put("RQ_RCS_LINE", new HashMap(){{
			put("低压",0.7);
			put("中压B",1);
			put("中压A",1.5);
			put("次高压B",5.0);
			put("次高压A",13.5);
		}});
		put("RQ_QTX_LINE", new HashMap(){{
			put("低压",0.7);
			put("中压B",1);
			put("中压A",1.5);
			put("次高压B",5.0);
			put("次高压A",13.5);
		}});
		put("DL_JTX_LINE", new HashMap(){{
			put("5",0.6);
			put("4",0.6);
			put("6",0.6);
			put("7",0.6);
		}});
		put("DL_GGX_LINE", new HashMap(){{
			put("5",0.6);
			put("4",0.6);
			put("6",0.6);
			put("7",0.6);
		}});
		put("DL_DCX_LINE", new HashMap(){{
			put("5",0.6);
			put("4",0.6);
			put("6",0.6);
			put("7",0.6);
		}});
		put("DL_GDX_LINE", new HashMap(){{
			put("5",0.6);
			put("4",0.6);
			put("6",0.6);
			put("7",0.6);
		}});
		put("DL_QTX_LINE", new HashMap(){{
			put("5",0.6);
			put("4",0.6);
			put("6",0.6);
			put("7",0.6);
		}});
		put("DL_DCS_LINE", new HashMap(){{
			put("5",0.6);
			put("4",0.6);
			put("6",0.6);
			put("7",0.6);
		}});
		put("DL_LDX_LINE", new HashMap(){{
			put("5",0.6);
			put("4",0.6);
			put("6",0.6);
			put("7",0.6);
		}});
		put("XX_TXX_LINE", new HashMap(){{
			put("3",1.5);
			put("5",1);
			put("4",1.5);
			put("6",1.5);
			put("7",1.5);
		}});
		put("XX_YXX_LINE", new HashMap(){{
			put("3",1.5);
			put("5",1);
			put("4",1.5);
			put("6",1.5);
			put("7",1.5);
		}});
		put("XX_GBX_LINE", new HashMap(){{
			put("3",1.5);
			put("5",1);
			put("4",1.5);
			put("6",1.5);
			put("7",1.5);
		}});
		put("XX_XCS_LINE", new HashMap(){{
			put("3",1.5);
			put("5",1);
			put("4",1.5);
			put("6",1.5);
			put("7",1.5);
		}});
		put("XX_QTX_LINE", new HashMap(){{
			put("3",1.5);
			put("5",1);
			put("4",1.5);
			put("6",1.5);
			put("7",1.5);
		}});

	}};

	public static final Map<String, Double> jzwAndGx2 =  new HashMap(){{
		put("RL_RSG_LINE", 3.0);
		put("RL_ZQG_LINE", 3.0);
		put("RL_QTX_LINE", 3.0);
		put("PS_YSG_LINE", 2.5);
		put("PS_WSG_LINE", 2.5);
		put("JS_ZSG_LINE", 1.0);
	}};
}
